<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=8">
    <title>左边导航</title>
    <link rel="stylesheet" type="text/css" href="../../static/left/reset.css"/>
    <link rel="stylesheet" type="text/css" href="../../static/left/common.css"/>
    {#    <script type="text/javascript" src="../../static/js/jquery-1.12.3.js"></script>#}
    <!--框架高度设置-->
    <script type="text/javascript">
        $(function () {
            $('.sidenav li').click(function () {
                $(this).siblings('li').removeClass('now');
                $(this).addClass('now');
            });

            $('.erji li').click(function () {
                $(this).siblings('li').removeClass('now_li');
                $(this).addClass('now_li');
            });

            var main_h = $(window).height();
            $('.sidenav').css('height', main_h + 'px');
        })
    </script>
    <!--框架高度设置-->
</head>

<body>
<div id="left_ctn">
    <ul class="sidenav">

        {#   课程管理     #}
        <li class="now">
            <div class="nav_m">
                <span><a>课程管理</a></span>
                <i>&nbsp;</i>
            </div>
            <ul class="erji">
                <li>
                    <a class="abcd_href" data-url="/admin/subject_list.html" target="main">主题列表</a>
                </li>
                <li>
                    <a class="abcd_href" data-url="/admin/subject_add.html" target="main">新增主题</a>
                </li>
                <li>
                    <a class="abcd_href" data-url="/admin/classify_list.html" target="main">分类列表</a>
                </li>
                <li>
                    <a class="abcd_href" data-url="/admin/classify_add.html" target="main">新增分类</a>
                </li>
                <li class="now_li">
                    <a class="abcd_href" data-url="/admin/course_list.html" target="main">课程列表</a>
                </li>
                <li>
                    <a class="abcd_href" data-url="/admin/course_add.html" target="main">添加课程</a>
                </li>
                <li>
                    <a class="abcd_href" data-url="/admin/chapter_list.html" target="main">章节列表</a>
                </li>
                <li>
                    <a class="abcd_href" data-url="/admin/chapter_add.html" target="main">添加章节</a>
                </li>
            </ul>
        </li>
        <li>
            <div class="nav_m">
                <span><a>教师管理</a></span>
                <i>&nbsp;</i>
            </div>
            <ul class="erji">
                <li>
                    <a class="abcd_href" data-url="/admin/teacher_list.html" target="main">教师列表</a>
                </li>
                <li>
                    <a class="abcd_href" data-url="/admin/teacher_add.html" target="main">新增教师</a>
                </li>
            </ul>
        </li>


    </ul>
</div>
<script>
    function left() {
        var c = sessionStorage.getItem('key_url');
        if (c != undefined){
            $.each($(".abcd_href"), function (index, t) {
            if (index == c) {
                $(".now").removeClass("now");
                $(".now_li").removeClass("now_li");
                $(this).parent().addClass("now_li");
                $(this).parent().parent().parent().addClass("now");
            }
        });
        }
    }

    $(".abcd_href").click(function () {
        var tmp = $(this).attr("data-url");
        $.each($(".abcd_href"), function (index, t) {
            if (tmp == $(t).attr("data-url")) {
                sessionStorage.setItem('key_url', index);
            }
        });
        location.href = tmp;
    });
    left();

</script>
</body>
</html>
